package com.tbb.app.base.vo;

import com.tbb.app.base.entity.Message;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(description = "消息VO")
public class MessageVO {
    @ApiModelProperty("id")
    private String id;

    @ApiModelProperty("发送人id")
    private String sendId;

    @ApiModelProperty("接收人id")
    private String receiveId;

    @ApiModelProperty("消息正文")
    private String text;

    public MessageVO(Message m) {
        this.id = m.getId();
        this.sendId = m.getSendUserId();
        this.receiveId = m.getReceiveUserId();
        this.text = m.getText();
    }

}
